package com.homegoods.designer.ui.activity;

import android.os.Bundle;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.homegoods.aroutercomment.ARouterPath;
import com.homegoods.designer.R;
import com.homegoods.designer.databinding.DesignerActivityCaseDetailBinding;
import com.homegoods.designer.model.CaseDetailModel;
import com.homegoods.designer.presenter.CaseDetailPresenter;
import com.kedll.library.base.MyBaseFragmentActivity;
import com.kedll.library.mvp.BaseView;
import com.kedll.library.util.MyUtils;
import com.share.sharelibrary.share.ShareData;

/**
 * @author QiQi
 * @description 案例详情
 */
@Route(path = ARouterPath.PATH_CASE_DETAIL)
public class CaseDetailActivity extends MyBaseFragmentActivity<DesignerActivityCaseDetailBinding, CaseDetailPresenter> implements BaseView {
    @Autowired(name = "data")
    public CaseDetailModel caseModel;

    @Override
    public int getLayout() {
        return R.layout.designer_activity_case_detail;
    }

    @Override
    protected void initEvent() {
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        super.initData(savedInstanceState);
        toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white);
        setTopRightButton("", R.drawable.designer_share_white, v -> new ShareData.Builder()
                .setShareType(ShareData.SHARE_TEXT)
                .setText("设计师")
                .builder()
                .startShare());
        mBinding.setPresenter(mPresenter);

        MyUtils.setSystemUi(getWindow(), false);
    }

    @Override
    protected void initToolBar(Bundle savedInstanceState) {
        super.initToolBar(savedInstanceState);
        ARouter.getInstance().inject(this);
    }

    @Override
    protected CaseDetailPresenter getPresenter() {
        return new CaseDetailPresenter(this, caseModel);
    }

}
